package day05.localDate;
import java.text.SimpleDateFormat;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;


/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/25

 * 4.求上个月的第三天是星期几？
*/
public class Test4 {
    public static void main(String[] args) {

        LocalDate date1 = LocalDate.now();

        LocalDate date2 = date1.minusMonths(1);
        System.out.println(date2);
        // 获取上个月的第三天
        LocalDate date = date2.withDayOfMonth(3);
        // 获取该日期对应的星期几
        DayOfWeek dayOfWeek = date.getDayOfWeek();
        System.out.println("上个月的第三天是星期: "+dayOfWeek.getValue());

    }
}
